package easyBD;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import hardBD.AudioLoaderV2;

public class main {
	public static void main(String[] args){
		new BeatDetect("1.mp3");
		
		//tryStereo();
	}
	
	public static void tryStereo(){
		byte[] track = new AudioLoaderV2().load("1.mp3");
		
		byte[] t = new byte[track.length/2];
		
		int seconndcount = 0;
		for(int i = 0; i < t.length; i++){
			t[i] = (byte)(track[seconndcount] + track[seconndcount+1]);
			seconndcount += 2;
		}
		
		File out = new File("1.wav");
		FileOutputStream ff = null;
		try {
			ff = new FileOutputStream(out);
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		try {
			ff.write(t);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
